function withLogging(WrappedComponent) {
  return function EnhancedComponent(props) {
    console.log('Component rendered');
    return <WrappedComponent {...props} />;
  };
}

function Welcome({ name }) {
  return <h1>Welcome, {name}!</h1>;
}

const EnhancedWelcome = withLogging(Welcome);